package com.cheems.controller;

import com.cheems.entity.Result.PageResult;
import com.cheems.entity.Result.Result;
import com.cheems.entity.DTO.pageParamsDTO;
import com.cheems.service.WallNewsService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@Slf4j
@Api(tags = "首页信息列表")
public class WallNewsController {

   @Autowired
    WallNewsService wallNewsService;
    /**
     * 获取首页信息列表
     * @return
     */
    @ApiOperation("获取首页信息列表")
    @PostMapping("/wallNewsList")
    public Result<PageResult> wallNews(@RequestBody pageParamsDTO pageParamsDTO){
        log.info("首页信息分页查询参数为,{}",pageParamsDTO);
        PageResult pageResult = wallNewsService.pageQuery(pageParamsDTO);
        return Result.success(pageResult);
    }
}
